package cn.tedu.kcircle.passport.infra.converter;

import cn.tedu.kcircle.passport.dao.entity.UserDO;
import cn.tedu.kcircle.passport.protocol.param.UserRegisterParam;
import cn.tedu.kcircle.passport.repository.model.UserRegisterModel;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

@Component
@AllArgsConstructor
public class PassportInfraConverter {
    private PasswordEncoder passwordEncoder;
    public UserDO model2DO(UserRegisterModel userRegisterModel){
        UserDO userDO = new UserDO();
        BeanUtils.copyProperties(userRegisterModel,userDO);
        return userDO;
    }
}
